package com.heima.user.controller;


import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.LoginDto;
import com.heima.user.service.IApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/login")
@Api("App端用户登录")
public class LoginController {
    @Autowired
    private IApUserService userService;


    @PostMapping("/login_auth")
    @ApiOperation(value = "login", notes = "App端用户登录")
    @ApiImplicitParam(name = "dto", dataType = "LoginDto", required = true)
    public ResponseResult login(@RequestBody LoginDto dto) {
        return userService.login(dto);
    }
}
